<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('【请填写功能名称】列表')" />
    <script src="../static/ruoyi/js/ry-ui.js"></script>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label style="width: 75px">监测点名称:</label>
                            <select name="monitorId" id="monitorId" >
                            </select>
                        </li>
                        <li>
                            <label>产生时间：</label>
                            <input type="text" placeholder="请选择查询开始时间" class="time-input" name="startTime" id="startTime"/>-
                            <input type="text" placeholder="请选择查询结束时间" class="time-input" name="endTime" id="endTime"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()" ><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>


        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript" type="text/javascript">

    var editFlag = [[${@permission.hasPermi('bus:minute:edit')}]];
    var removeFlag = [[${@permission.hasPermi('bus:minute:remove')}]];
    var prefix = ctx + "bus/data";
    $(document).ready(function(){
        loadDepartmentName();
    });
    function loadDepartmentName() {
        $.ajax({
            url: "/bus/monitor/list",
            type: "post",
            success: function (data) {
                var nameOpt = "<option value='' selected='selected'>--请选择--</option>";
                for (var i = 0; i < data.rows.length; i++) {
                    nameOpt+="<option value='"+data.rows[i].monitorId+"' >"+data.rows[i].monitorName+"</option>"
                    $('#monitorId').html(nameOpt);
                    document.getElementsByTagName("tr[0]")
                }
            }

        });
    };
    $(function() {
        var options = {
            url: prefix + "/list",
            columns: [
                {
                    field: 'monitorId',
                    title: 'monitorId',
                    visible: false
                },
                {
                    field: 'monitorName',
                    title: '监测点',

                },
                {
                    field: 'produceTime',
                    title: '产生时间'
                },
                {
                    field: 'ad',
                    title: '氨氮(mg/L)',
                    formatter: function(value, row, index){
                        // debugger
                        if(row.adFlag=="1") {
                            return '<span style="color:#fa4347">'+value+'</span>';
                        }else{
                            return value;
                        }
                    }

                },
                {
                    field: 'zl',
                    title: '总磷(mg/L)',
                    formatter: function(value, row, index){
                        // debugger
                        if(row.zlFlag=="1") {
                            return '<span style="color:#fa4347">'+value+'</span>';
                        }else{
                            return value;
                        }
                    }

                },
                {
                    field: 'cod',
                    title: '高锰酸盐(mg/L)',
                    formatter: function(value, row, index){
                        // debugger
                        if(row.codFlag=="1") {
                            return '<span style="color:#fa4347">'+value+'</span>';
                        }else{
                            return value;
                        }
                    }
                },
                {
                    field: 'ph',
                    title: 'PH',
                    formatter: function(value, row, index){
                        // debugger
                        if(row.phFlag=="1") {
                            return '<span style="color:#fa4347">'+value+'</span>';
                        }else{
                            return value;
                        }
                    }
                },
                {
                    field: 'cond',
                    title: '电导率(S/m)',
                    formatter: function(value, row, index){
                        // debugger
                        if(row.condFlag=="1") {
                            return '<span style="color:#fa4347">'+value+'</span>';
                        }else{
                            return value;
                        }
                    }
                },
                {
                    field: 'ry',
                    title: '溶氧(mg/L)',
                    formatter: function(value, row, index){
                        // debugger
                        if(row.ryFlag=="1") {
                            return '<span style="color:#fa4347">'+value+'</span>';
                        }else{
                            return value;
                        }
                    }
                },
                {
                    field: 'zd',
                    title: '浊度(NTU)',
                    formatter: function(value, row, index){
                        // debugger
                        if(row.zdFlag=="1") {
                            return '<span style="color:#fa4347">'+value+'</span>';
                        }else{
                            return value;
                        }
                    }
                },
                {
                    field: 'wd',
                    title: '温度℃',
                    formatter: function(value, row, index){
                        // debugger
                        if(row.wdFlag=="1") {
                            return '<span style="color:#fa4347">'+value+'</span>';
                        }else{
                            return value;
                        }
                    }
                },
                {
                    field: 'cr',
                    title: '六价铬',
                    formatter: function(value, row, index){
                        // debugger
                        if(row.crFlag=="1") {
                            return '<span style="color:#fa4347">'+value+'</span>';
                        }else{
                            return value;
                        }
                    }
                }
                ]
        };
        $.table.init(options);
    });

</script>
</body>
</html>